# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=udevil
pkgver=0.4.4
pkgrel=3
pkgdesc="Mount / unmount removable devices without a password (udisks alternative)"
url="http://ignorantguru.github.io/udevil"
arch="all"
license="GPL-3.0-or-later"
makedepends="eudev-dev glib-dev intltool"
install="$pkgname.pre-install"
subpackages="$pkgname-lang $pkgname-doc"
pkggroups="plugdev"
source="$pkgname-$pkgver.tar.gz::https://github.com/IgnorantGuru/udevil/archive/$pkgver.tar.gz"

build() {
	./configure \
		--prefix=/usr \
		--disable-systemd
	make
}

package() {
	make DESTDIR="$pkgdir" install
	chown root:plugdev "$pkgdir"/usr/bin/udevil
	chmod u+s,go-s,o-x "$pkgdir"/usr/bin/udevil # remove SUID bit
	mkdir -p "$pkgdir/usr/share/apk-tools/$pkgname"
#	chmod ugo-s,ugo+x "$pkgdir"/usr/bin/udevil #remove SUID bit completely
	# post-install message
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <<EOF
To mount / unmount devices without the root password: add your user account to the 'plugdev' group.

Optional dependencies:

zenity: 	(devmon popups)
davfs2: 	(mount WebDAV resources)
cifs-utils: 	(mounting samba shares)
curlftpfs: 	(mounting ftp shares)
nfs-utils: 	(mounting nfs shares)
sshfs-fuse: 	(mounting sftp shares)
eject: 		(eject via devmon)
EOF
}

sha512sums="adce4916e06d1cc4965521abbcbc2901e53930691167f431cb18e28d3ef8bde740e95a6a5f40dfc58dfd7b4b661b4475d3dd2b6174a5d7a55ae7c65629b82327  udevil-0.4.4.tar.gz"
